-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only sleep if there are no tasks #91
Conversation
I'm not sure how I feel about this, as it changes the definition of "interval". It could be surprising to some people. This change increases throughput, but also adds DB load. It's also arguably a breaking change. |
Fair points; on the other hand, I don't think it's common/expected for a task queue to throttle its throughput to keep resource use under control. If a user really wants this, they could add a |
django_tasks/backends/database/management/commands/db_worker.py
Outdated
Show resolved
Hide resolved
django_tasks/backends/database/management/commands/db_worker.py
Outdated
Show resolved
Hide resolved
Change looks good now! Although I'm a little concerned about it being a breaking change. The help text for |
That's a good argument for the next release being
How about The interval (in seconds) to wait, when there are no tasks in the queue, before checking for tasks again? |
Works for me!
It probably will be. I've got some other bigger changes in the work which warrant a larger release bump. |
Alright; I've updated the |
I was running the DB worker on a queue full of tasks, and was wondering why it was only processing one task per second. It's bad form to sleep when there is work to do.